PARSER = ../../core/java/parser.jar

OCL = /Users/andreiarusoaie/work/k-modeling
KML = $(OCL)/core/java/kml.jar

CGT_MM = ../../core/grammars/metamodels.cgt
CGT_M = ../../core/grammars/models.cgt
CGT_RL = ../../core/grammars/kmrl.cgt

FILE_MM = authors.mm
FILE_M = instance.m
# FILE_RL = xSPEM.rl

all: k compile

metamodel:
	java -jar $(KML) --metamodel $(FILE_MM) --parse

model:
	java -jar $(KML) --model $(FILE_M) --parse

kmrl:
#	java -jar $(PARSER) $(FILE_RL) $(CGT_RL)

k:
	java -jar $(KML) --metamodel $(FILE_MM) --model $(FILE_M) --k

compile:
	chmod +x $(OCL)/core/ocl-semantics/tools/compile.pl
	$(OCL)/core/ocl-semantics/tools/compile.pl $(K_BASE)/core/kompile $(K_BASE)/core/maude/lib/k-prelude.maude $(OCL)/core/ocl-semantics/ocl/values.maude model.k

clean:
	rm -f classdiagram.k model.k k-prelude.maude *~
